/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package puntoventa.modelo;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;
import puntoventa.modelo.Roles;

/**
 *
 * @author infor
 */
@Entity
@Table(name = "rolesformularios", catalog = "pv", schema = "public")
@NamedQueries({
    @NamedQuery(name = "Rolesformularios.findAll", query = "SELECT r FROM Rolesformularios r"),
    @NamedQuery(name = "Rolesformularios.findByIdRolesformularios", query = "SELECT r FROM Rolesformularios r WHERE r.idRolesformularios = :idRolesformularios"),
    @NamedQuery(name = "Rolesformularios.findByIdFormularios", query = "SELECT r FROM Rolesformularios r WHERE r.idFormularios = :idFormularios"),
    @NamedQuery(name = "Rolesformularios.findByEstadoRolesformularios", query = "SELECT r FROM Rolesformularios r WHERE r.estadoRolesformularios = :estadoRolesformularios"),
    @NamedQuery(name = "Rolesformularios.findByAgregarRolesformularios", query = "SELECT r FROM Rolesformularios r WHERE r.agregarRolesformularios = :agregarRolesformularios"),
    @NamedQuery(name = "Rolesformularios.findByModificarRolesformularios", query = "SELECT r FROM Rolesformularios r WHERE r.modificarRolesformularios = :modificarRolesformularios"),
    @NamedQuery(name = "Rolesformularios.findByEliminarRolesformularios", query = "SELECT r FROM Rolesformularios r WHERE r.eliminarRolesformularios = :eliminarRolesformularios"),
    @NamedQuery(name = "Rolesformularios.findByListarRolesformularios", query = "SELECT r FROM Rolesformularios r WHERE r.listarRolesformularios = :listarRolesformularios")})
public class Rolesformularios implements Serializable {
    @Transient
    private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_rolesformularios")
    private Integer idRolesformularios;
    @Column(name = "id_formularios")
    private Integer idFormularios;
    @Column(name = "estado_rolesformularios")
    private Boolean estadoRolesformularios;
    @Column(name = "agregar_rolesformularios")
    private Boolean agregarRolesformularios;
    @Column(name = "modificar_rolesformularios")
    private Boolean modificarRolesformularios;
    @Column(name = "eliminar_rolesformularios")
    private Boolean eliminarRolesformularios;
    @Column(name = "listar_rolesformularios")
    private Boolean listarRolesformularios;
    @JoinColumn(name = "id_roles", referencedColumnName = "id_roles")
    @ManyToOne
    private Roles idRoles;

    public Rolesformularios() {
    }

    public Rolesformularios(Integer idRolesformularios) {
        this.idRolesformularios = idRolesformularios;
    }

    public Integer getIdRolesformularios() {
        return idRolesformularios;
    }

    public void setIdRolesformularios(Integer idRolesformularios) {
        Integer oldIdRolesformularios = this.idRolesformularios;
        this.idRolesformularios = idRolesformularios;
        changeSupport.firePropertyChange("idRolesformularios", oldIdRolesformularios, idRolesformularios);
    }

    public Integer getIdFormularios() {
        return idFormularios;
    }

    public void setIdFormularios(Integer idFormularios) {
        Integer oldIdFormularios = this.idFormularios;
        this.idFormularios = idFormularios;
        changeSupport.firePropertyChange("idFormularios", oldIdFormularios, idFormularios);
    }

    public Boolean getEstadoRolesformularios() {
        return estadoRolesformularios;
    }

    public void setEstadoRolesformularios(Boolean estadoRolesformularios) {
        Boolean oldEstadoRolesformularios = this.estadoRolesformularios;
        this.estadoRolesformularios = estadoRolesformularios;
        changeSupport.firePropertyChange("estadoRolesformularios", oldEstadoRolesformularios, estadoRolesformularios);
    }

    public Boolean getAgregarRolesformularios() {
        return agregarRolesformularios;
    }

    public void setAgregarRolesformularios(Boolean agregarRolesformularios) {
        Boolean oldAgregarRolesformularios = this.agregarRolesformularios;
        this.agregarRolesformularios = agregarRolesformularios;
        changeSupport.firePropertyChange("agregarRolesformularios", oldAgregarRolesformularios, agregarRolesformularios);
    }

    public Boolean getModificarRolesformularios() {
        return modificarRolesformularios;
    }

    public void setModificarRolesformularios(Boolean modificarRolesformularios) {
        Boolean oldModificarRolesformularios = this.modificarRolesformularios;
        this.modificarRolesformularios = modificarRolesformularios;
        changeSupport.firePropertyChange("modificarRolesformularios", oldModificarRolesformularios, modificarRolesformularios);
    }

    public Boolean getEliminarRolesformularios() {
        return eliminarRolesformularios;
    }

    public void setEliminarRolesformularios(Boolean eliminarRolesformularios) {
        Boolean oldEliminarRolesformularios = this.eliminarRolesformularios;
        this.eliminarRolesformularios = eliminarRolesformularios;
        changeSupport.firePropertyChange("eliminarRolesformularios", oldEliminarRolesformularios, eliminarRolesformularios);
    }

    public Boolean getListarRolesformularios() {
        return listarRolesformularios;
    }

    public void setListarRolesformularios(Boolean listarRolesformularios) {
        Boolean oldListarRolesformularios = this.listarRolesformularios;
        this.listarRolesformularios = listarRolesformularios;
        changeSupport.firePropertyChange("listarRolesformularios", oldListarRolesformularios, listarRolesformularios);
    }

    public Roles getIdRoles() {
        return idRoles;
    }

    public void setIdRoles(Roles idRoles) {
        Roles oldIdRoles = this.idRoles;
        this.idRoles = idRoles;
        changeSupport.firePropertyChange("idRoles", oldIdRoles, idRoles);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idRolesformularios != null ? idRolesformularios.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Rolesformularios)) {
            return false;
        }
        Rolesformularios other = (Rolesformularios) object;
        if ((this.idRolesformularios == null && other.idRolesformularios != null) || (this.idRolesformularios != null && !this.idRolesformularios.equals(other.idRolesformularios))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "puntoventa.formulario.Rolesformularios[ idRolesformularios=" + idRolesformularios + " ]";
    }

    public void addPropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.removePropertyChangeListener(listener);
    }
    
}
